package com.yuandian.management.controller;

import com.yuandian.api.management.entity.ConfComponentIp;
import com.yuandian.bpm.common.core.util.R;
import com.yuandian.management.service.ConfComponentIpService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * 组件IP配置表-Controller
 * @author zfsn
 * @date 2023-3-16
 */
@Api(tags = "探针管理-采集过滤管理")
@RestController
@RequestMapping("/probeFilter")
public class ConfProbeFilterController {

	@Autowired
	private ConfComponentIpService confComponentIpService;


	/**
	 * 查询探针ip过滤分页信息
	 *
	 * @param confComponentIp
	 *
	 * @return 通用返回对象
	 */
	@PostMapping("/queryInfoFilterIp")
	@ApiOperation(value = "查询探针ip过滤分页信息", notes = "查询探针ip过滤分页信息")
	public R queryInfoFilterIp(@RequestBody ConfComponentIp confComponentIp) {
		return R.ok(confComponentIpService.queryInfoFilterIp(confComponentIp));
	}




	/**
	 * 新增 ip过滤信息
	 *
	 * @param confComponentIp
	 *
	 * @return 通用返回对象
	 */
	@PostMapping("/editFilterIpInfo")
	@ApiOperation(value = "新增 ip过滤信息", notes = "新增 ip过滤信息")
	public R editFilterIpInfo(@RequestBody ConfComponentIp confComponentIp) {
		return confComponentIpService.updateFilterIpInfo(confComponentIp);
	}

	/**
	 * 停止 ip过滤信息
	 *
	 * @param confComponentIp
	 *
	 * @return 通用返回对象
	 */
	@PostMapping("/stopFilterIpInfo")
	@ApiOperation(value = "停止 ip过滤信息", notes = "停止 ip过滤信息")
	public R stopFilterIpInfo(@RequestBody ConfComponentIp confComponentIp) {
		return confComponentIpService.updateFilterIpInfo(confComponentIp);
	}

}
